from django import forms


class LoginForm(forms.Form):
    username = forms.CharField(max_length=20,
                               min_length=3,
                               error_messages={
                                   'required': '用户名不能为空',
                                   'min_length': '用户名长度不能小于3',
                                   'max_length': '用户名长度不能大于20'
                               })
    password = forms.CharField(max_length=20,
                               min_length=6,
                               error_messages={
                                   'required': '密码不能为空',
                                   'min_length': '密码长度不能小于6',
                                   'max_length': '密码长度不能大于20'
                               })
    remember = forms.BooleanField(required=False)
